motorcycles = ['honda','yamaha','suzuki']
print(motorcycles)

# #修改列表中的值
motorcycles[0] = 'ducati'
print(motorcycles)
#
# #新增列表中的值
motorcycles = ['honda','yamaha','suzuki']
motorcycles.append("ducati")
print(motorcycles)

warships = []
warships.append("战列舰")
warships.append("航空母舰")
warships.append("巡洋舰")
warships.append("驱逐舰")
print(warships)

warships.insert(0,"护卫舰")
print(warships)

# #删除元素
metroCycles = ['honda','ymaha','suzuki']
print(metroCycles)
#
# #删除第二个元素
del metroCycles[1]
print(metroCycles)

#使用pop方法删除元素
metroCycles = ['honda','ymaha','suzuki']
print(metroCycles)
#删除最后一个元素,并将删除元素返回
poped_cycles = metroCycles.pop()
print(metroCycles)
print(poped_cycles)

#使用pop删除指定位置的值,并返回删除的值
metroCycles = ["honda","yamaha","suzuki"]
print(metroCycles)
poped_cycles = metroCycles.pop(0)
print(metroCycles)
print(poped_cycles)
print(f'我买的第一辆摩托车是{poped_cycles}')

#根据值来删除元素
motorCycle = ['honda','yamaha','suzuki','ducati']
print(motorCycle)
expensive_cycle = 'ducati'
motorCycle.remove(expensive_cycle)
print(f'\n{expensive_cycle}对我来说太贵了')